package jdesktop.appbar.win32;

import java.awt.*;

/**
 * Handles the synchronous methods that must execute on the windows event thread.
 * Note that use of Swing components is generally a bad idea, since these
 * must be accessed on the AWT event thread. Using locks and other blocking
 * semantics can cause deadlock. Any locking used should have a timeout.
 */
class WindowsThreadMessageHandler extends DelegateWindowMessageHandler
{
    WindowsThreadMessageHandler(WindowMessageHandler delegate)
    {
        super(delegate);
    }

    WindowsThreadMessageHandler()
    {
    }

    @Override
    public Rectangle appBarSizing(int uParam, int left, int top, int right, int bottom)
    {
        return null;
    }

    @Override
    public int appBarHitTest(int x, int y, int hit)
    {
        // allow the client area to function as the caption.
        // But, we should filter out components, so these can be clicked.
        if (hit==User32.HTCLIENT)
            hit = User32.HTCAPTION;
        return hit;
    }
}
